﻿
<template>



    <div class="tab-filter-type pt20" v-show="isshow">
        <div class="oh">
            <h5 class="pull-left tr">管理站：</h5>
            <ul class="tab-type ft14">
                <li v-for="lb in lbdata"><span v-bind:class="{ 'active': lb.issel }" @click="sellb(lb)" v-text="lb.itemtext"></span></li>
            </ul>
        </div>
    </div>

</template>


<script>
    //输出得查询格式必须为{ colid: obj.cxzd, cal: obj.cal, val: va.itemtext }，colid为字段,cal为查询类型(0:等于,1:包含-逗号隔开).val为值
    module.exports = {
        props: ['pzoption'],
        data() {
            return {
                qzsj: "",
                isshow: false,
                lbdata: [{ issel: false, itemtext: "青化灌溉站" }, { issel: false, itemtext: "汤峪灌溉站" }, { issel: false, itemtext: "齐镇灌溉站" }, { issel: false, itemtext: "金渠灌溉站" }, { issel: false, itemtext: "安乐灌溉站" }],
            };
        },
        computed: {
            dx: function () {
                return this.isdx == "";
            }
        },
        methods: {
            sellb: function (lb) {
                _.forEach(this.lbdata, function (obj) {
                    obj.issel = false;
                })
                lb.issel = true;
                if (lb.itemtext != "全部") {
                    this.pzoption.value = [{ colid: "zname", cal: "0", val: lb.itemtext }];
                } else {
                    this.pzoption.value = [];

                }
                this.$parent.Query();
            },
        },
        mounted: function () {
            var chi = this;
            chi.$nextTick(function () {
                var userrole = top.model.UserInfo.UserRoleCode;
                if (userrole.indexOf('1218') > -1 || userrole.indexOf('1268') > -1 || userrole.indexOf('1269') > -1) {
                    chi.isshow = true;
                }
                this.$parent.Query();

            })

        }
    };
</script>